package net.sga.entities;

import java.io.Serializable;
import java.util.Arrays;

import net.sga.entities.enm.NivelTime;

public class Time implements Serializable{
	
	private static final long serialVersionUID = -1206125536221161686L;
	
	private String nome;
	private byte[] escudo;
	private NivelTime level;
	
	public Time() {
	}
	
	public Time(String nome, NivelTime level) {
		super();
		this.nome = nome;
		this.level = level;
	}

	public Time(String nome, byte[] escudo, NivelTime level) {
		this.nome = nome;
		this.escudo = escudo;
		this.level = level;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public byte[] getEscudo() {
		return escudo;
	}

	public void setEscudo(byte[] escudo) {
		this.escudo = escudo;
	}

	public NivelTime getLevel() {
		return level;
	}

	public void setLevel(NivelTime level) {
		this.level = level;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Arrays.hashCode(escudo);
		result = prime * result + ((level == null) ? 0 : level.hashCode());
		result = prime * result + ((nome == null) ? 0 : nome.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Time other = (Time) obj;
		if (!Arrays.equals(escudo, other.escudo))
			return false;
		if (level != other.level)
			return false;
		if (nome == null) {
			if (other.nome != null)
				return false;
		} else if (!nome.equals(other.nome))
			return false;
		return true;
	}

}
